<template>
  <div class="schedule">
    <h3>待办事项</h3>
    <div class="scheduleList">
      <div class="scheduleItem">
        <n-badge :value="value" dot @click="goOutLink(1)">精进日报待处理</n-badge>
      </div>
      <div class="scheduleItem">
        <n-badge :value="value" @click="goOutLink(2)">五项清单待处理</n-badge>
      </div>
      <div class="scheduleItem">
        <n-badge :value="value" @click="goOutLink(3)">BPM流程待处理</n-badge>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
const value = ref(10)
const goOutLink = (type) => {
  const token = localStorage.getItem('token')
  const sscLink = 'https://ssc.homedo.com/tabPage/appStore?menuId1=43&menuId2=109&taskId=538208'
  const URL_MAP = {
    1: token ? sscLink + '&token=' + token : sscLink,
    2: 'https://dida.homedo.com/listAgent/index.vue'
  }
  const DEFAULT_URL = 'https://www.baidu.com'
  const url = URL_MAP[Number(type)] || DEFAULT_URL
  window.electronAPI.send('goLink', url);
}
</script>

<style scoped lang="scss">
.schedule {
  .scheduleList {
    .scheduleItem {
      cursor: pointer;
    }
  }
}
</style>
